package com.zjp.test.kafka;

import java.util.concurrent.CountDownLatch;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class Application {

	Logger log = LoggerFactory.getLogger(Application.class);
	@Autowired
	KafkaTemplate<String, String> producer;
	
	@RequestMapping("/")
	String hello(String aaa){
		producer.send("test","key",aaa);
		return "hello world";
	}
	
	public static void main(String[] args) {
		 SpringApplication.run(Application.class, args);
	}
}
